using UnityEngine;
using System.Collections;

/// \class  gkInputScreenZoneTouch
/// \brief  The screen touch input wrapper
[AddComponentMenu("GK/Engine/Core/Input/gkInputScreenZoneTouch")]
public class gkInputScreenZoneTouch : MonoBehaviour
{
    /// The maximum tilt rotation in degree
    public string ButtonInputName = "";
	
	/// Is the zone touched
	private bool m_bZoneTouched;
	
    /// \brief  Called each frame
    void Update()
    {
		if(Application.platform == RuntimePlatform.IPhonePlayer)
		{
			if(Input.touchCount > 0)
			{
				m_bZoneTouched = true;
			}
			else
			{
				m_bZoneTouched = false;
			}
		}
		else
		{		
		    if(Input.GetButton(ButtonInputName))
			{
				m_bZoneTouched = true;
			}
			else
			{
				m_bZoneTouched = false;
			}	
		}
    }
	
	/// \brief  Is the zone touched
	public bool IsZoneTouched()
	{
		return m_bZoneTouched;
	}
}
